package com.tony.blog.model.mapper;

import com.tony.blog.model.entity.ConcernEntity;
import org.apache.ibatis.annotations.Param;

import java.util.Set;

/**
 * Created with IntelliJ IDEA.
 *
 * @Title: ConcernMapper
 * @Auther: 皮蛋布丁
 * @Date: 2021/08/16/20:37
 * @Description: 关注-被关注表（我的粉丝、我的关注-好友圈）
 */
public interface ConcernMapper {

    /**
    * @Description: countByConcernBeId 根据关注者id和被关注者id获取关注的数量
    * @Param: [concernId, beConcernId]
    * @return: java.lang.Integer
    * @Author: 皮蛋布丁
    * @Date: 2021/8/16 20:37
    */
    Integer countByConcernBeId(@Param("concernId") Integer concernId, @Param("beConcernId") Integer beConcernId);

    /**
    * @Description: countFansByUserId 获取关粉丝数
    * @Param: [userId]
    * @return: java.lang.Integer
    * @Author: 皮蛋布丁
    * @Date: 2021/8/19 20:14
    */
    Integer countFansByUserId(@Param("userId") int userId);

    /**
    * @Description: countConcernsByUserId 获取微博数
    * @Param: [userId]
    * @return: java.lang.Integer
    * @Author: 皮蛋布丁
    * @Date: 2021/8/19 20:20
    */
    Integer countConcernsByUserId(@Param("userId") int userId);

    /**
    * @Description: insertSelective 插入关注信息
    * @Param: [concern]
    * @return: java.lang.Integer
    * @Author: 皮蛋布丁
    * @Date: 2021/8/28 21:25
    */
    Integer insertSelective(ConcernEntity concern);

    /**
    * @Description: deletebyConcernById 取消关注
    * @Param: [concernId, beConcernUserId]
    * @return: java.lang.Integer
    * @Author: 皮蛋布丁
    * @Date: 2021/8/29 22:02
    */
    Integer deletebyConcernById(@Param("concernId") Integer concernId,@Param("beConcernId") Integer beConcernUserId);

    /**
    * @Description: selectMyConcerns 根据用户id获取关注表
    * @Param: [userId]
    * @return: java.util.Set<java.lang.Integer>
    * @Author: 皮蛋布丁
    * @Date: 2021/9/16 10:52
    */
    Set<Integer> selectMyConcerns(@Param("userId") int userId);
}
